package cn.dnui_xcz826.dnuifood_16110100826.model;

import cn.dnui_xcz826.dnuifood_16110100826.iface.OrderIface;
import cn.dnui_xcz826.dnuifood_16110100826.listener.onRetrofitListener;
import cn.dnui_xcz826.dnuifood_16110100826.service.OrderService;
import retrofit2.Call;

/**
 * Created by Administrator on 2018/11/19.
 */

public class OrderModel extends BaseModel implements OrderIface {
    private OrderService service;
    public OrderModel(){
        super();
        service=retrofit.create(OrderService.class);
    }

    @Override
    public void insertOrder(String user_id, String address, String sum, String suggesttime, String items, onRetrofitListener listener) {
        Call call=service.doInsertOrder(user_id,address,sum,suggesttime,items);
        bindCallback(call,listener,20);
    }

    @Override
    public void getAllOrdersByUser(String user_id, onRetrofitListener listener) {
        Call call=service.doGetAllOrdersByUser(user_id);
        bindCallback(call,listener,21);
    }
}
